この手順では、Visual Studio で、TileListBox for UWP を使用して UWP アプリケーションを作成します。
次の手順に従います。
<Grid>
タグと </Grid>
タグの間にカーソルを置き、1回クリックします。<Grid>
タグと </Grid>
タグの間に次の <StackPanel>
マークアップを追加して、TextBlock と ProgressBar を含む StackPanel を追加します。
コードのコピー
|
|
---|---|
<StackPanel x:Name="loading" VerticalAlignment="Center"> <TextBlock Text="YouTubeからデータを取得しています..." TextAlignment="Center"/> <ProgressBar IsIndeterminate="True" Width="200" Height="4"/> </StackPanel> |
<Xaml:C1TileListBox>
タグを編集して、コントロールをカスタマイズします。
コードのコピー
|
|
---|---|
<Xaml:C1TileListBox x:Name="tileListBox" ItemsSource="{Binding}" Background="Transparent" Visibility="Collapsed" ItemWidth="800" ItemHeight="600" RefreshWhileScrolling="False"></Xaml:C1TileListBox> |
<Xaml:C1TileListBox>
タグと </Xaml:C1TileListBox>
タグの間に次のマークアップを追加します。
コードのコピー
|
|
---|---|
<Xaml:C1TileListBox.PreviewItemTemplate> <DataTemplate> <Grid Background="Gray"/> </DataTemplate> </Xaml:C1TileListBox.PreviewItemTemplate> <Xaml:C1TileListBox.ItemTemplate> <DataTemplate> <Grid Background="LightBlue"> <Image Source="{Binding Thumbnail}" Stretch="UniformToFill"/> <TextBlock Text="{Binding Title}" Foreground="White" Margin="4 0 0 4" VerticalAlignment="Bottom"/> </Grid> </DataTemplate> </Xaml:C1TileListBox.ItemTemplate> |
これで、C1TileListBox コントロールを含む UWP スタイルのアプリケーションを作成できました。次の「手順2:TileListBox へのデータの追加」では、C1TileListBox にデータを追加します。